/*
 *  ------------------------------------------------------------------
 *  Copyright © 2017 Hangzhou DtDream Technology Co.,Lt d. All rights reserved.
 *  ------------------------------------------------------------------
 *              Product: EMR
 *    Module Name: DataTrain
 *      Date Created: 2017-10-23
 *         Description:
 *  ------------------------------------------------------------------
 *  Modification History
 *  DATE            Name           Description
 *  ------------------------------------------------------------------
 *  2017-10-23     XZ 209
 *  ------------------------------------------------------------------
 */

package org.xukai.remoting.sdk.rpc.writer;


import com.sun.prism.impl.Disposer.Record;

public interface Writer extends AutoCloseable {

    int getId();

    /**
     * 写入数据
     *
     * @param record
     */
    void write(Record record) throws TransmissionException;

    /**
     * 关闭Writer
     */
    void close() throws TransmissionException;

    boolean isClosed();

    /**
     * 发生错误时，设置错误信息
     * @param errorCode， 错误码
     */
    void setError(TransmissionException errorCode);
}
